#! /usr/bin/python

input_xml_string = """ 
                   <root> 
                        <item> 
                            <data version="1.0" url="http://***" /> 
                            <data version="2.0" url="http://***" /> 
                         </item> 
                         <other> 
                             <data version="1.0" url="http://***" /> 
                             <data version="2.0" url="http://***" /> 
                          </other> 
                     </root> 
                     """  

import xml.dom.minidom  

def get_tagname():  
	doc = xml.dom.minidom.parseString(input_xml_string)  
	for node in doc.getElementsByTagName("data"):  
		print (node, node.tagName, node.getAttribute("version"))

get_tagname()
